<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
// API 模板文件，可以复制
namespace api\resource\controller;

use think\Db;
use think\Request;
use think\Validate;
use cmf\controller\RestBaseController;

class Biao40Controller extends RestBaseController
{


    public function one($data)
    {

        //查 这个表的数据
        @$new_data = $data[0]['content'];
        if (empty($new_data)) {
            return '';
        }
        @$text11 = $new_data->text11;
        @$text11 = json_decode($text11);

        @$text12 = $new_data->text12;
        @$text12 = json_decode($text12);



       $html = '
       <div style="width: 650px;margin: 0 auto;">
            <div style="font-size: 16px;font-weight: 600;margin-bottom: 15px;">二、知识产权汇总表</div>
            <table border="1" cellspacing="0px" cellpadding="5px" width="650">
                <tbody>
                <tr>
                    <td rowspan="5">获得知识产权数量(件)</td>
                    <td>发明专利</td>
                    <td>'.@$new_data->text1.'</td>
                    <td>其中：国防专利</td>
                    <td colspan="2">'.@$new_data->text2.'</td>
                </tr>
                <tr>
                    <td>植物新品种</td>
                    <td>'.@$new_data->text3.'</td>
                    <td>国家级农作物品种</td>
                    <td colspan="2">'.@$new_data->text4.'</td>
                </tr>
                <tr>
                    <td>国家新药</td>
                    <td>'.@$new_data->text5.'</td>
                    <td>国家一级中药保护品种</td>
                    <td colspan="2">'.@$new_data->text6.'</td>
                </tr>
                <tr>
                    <td>集成电路布图设计专有权</td>
                    <td>'.@$new_data->text7.'</td>
                    <td>实用新型</td>
                    <td colspan="2">'.@$new_data->text8.'</td>
                </tr>
                <tr>
                    <td>外观设计</td>
                    <td>'.@$new_data->text9.'</td>
                    <td>软件著作权</td>
                    <td colspan="2">'.@$new_data->text10.'</td>
                </tr>
                <tr>
                    <td>知识产权编号</td>
                    <td>知识产权名称</td>
                    <td>类别</td>
                    <td>授权日期</td>
                    <td>授权号</td>
                    <td>获得方式</td>
                </tr>';

                if ($text11) {
                    @$i = 1;
                    foreach (@$text11 as $v) {
                        $html .='
                            <tr>
                                <td>'.@$i.'</td>
                                <td>'.@$v->text1.'</td>
                                <td>'.@$v->text2.'</td>
                                <td>'.@$v->text3.'</td>
                                <td>'.@$v->text4.'</td>
                                <td>'.@$v->text5.'</td>
                            </tr>
                            ';
                        $i++;
                    }
                }



                    if ($text12) {

                        @$i = 1;
                        foreach (@$text12 as $v) {

                            $html .='
                            <tr>
                            <td>序号</td>
                                <td colspan="5">'.@$i.'</td>
                            </tr>
                            <tr>
                                <td>所属项目编号</td>
                                <td colspan="2">'.@$v->text1.'</td>
                                <td>所属项目编号</td>
                                <td colspan="2">'.@$v->text2.'</td>
                            </tr>
                            <tr>
                                <td>知识产权名称</td>
                                <td colspan="2">'.@$v->text3.'</td>
                                <td>是否为有效知识产权</td>
                                <td colspan="2">'.@$v->text4.'</td>
                            </tr>
                            <tr>
                                <td>类别</td>
                                <td>'.@$v->text5.'</td>
                                <td>国内实用新型专利/国内发明专利/软件著作权/PCT</td>
                                <td>获得方式</td>
                                <td colspan="2">'.@$v->text6.'</td>
                            </tr>
                            <tr>
                                <td>授权号</td>
                                <td colspan="2">'.@$v->text7.'</td>
                                <td>所有权日期</td>
                                <td colspan="2">'.@$v->text8.'</td>
                            </tr>
                            <tr>
                                <td>专利权人</td>
                                <td colspan="2">'.@$v->text9.'</td>
                                <td>'.@$v->text10.'</td>
                                <td colspan="2">'.@$v->text11.'</td>
                            </tr>
                            <tr>
                                <td colspan="6">
                                    <div>国家知识产权局官方网站上公布的摘要</div>
                                    '.@$v->text12.'
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6">
                                    <div>与本知识产权相关的核心关键技术先进性说明</div>
                                    '.@$v->text13.'
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6">
                                    <div>该知识产权与本企业主营产品（服务）核心技术的支持作用说明</div>
                                    '.@$v->text14.'
                                </td>
                            </tr>
                            ';
                            $i++;
                        }
                    }







                $html .='
                </tbody>
            </table>
        </div>
        ';

            return $html;

    }



}
